<template>
  <div>
    <home-header :cityList='cityList'></home-header>
    <home-swiper :swiperList='swiperList'></home-swiper>
    <home-icons :iconList='iconList'></home-icons>
    <home-recommend :recommendList='recommendList'></home-recommend>
    <home-weekend :weekendList='weekendList'></home-weekend>
  </div>
</template>
<script>
import HomeHeader from "./components/home-header.vue";
import HomeSwiper from "./components/home-swiper";
import HomeIcons from "./components/home-icons";
import HomeRecommend from "./components/home-recommend";
import HomeWeekend from "./components/home-weekend";

export default {
  name: "Home",
  data() {
      return {
          weekendList:[],
          iconList:[],
          recommendList:[],
          swiperList:[],
          cityList:{}
      }
  },
  created(){
      this.$Axios({
      method:'get',
      url:'/index'
    }).then(backdata=>{
    let {weekendList,iconList,recommendList,swiperList} = backdata.data.data
    this.weekendList = weekendList
    this.iconList = iconList
    this.recommendList = recommendList
    this.swiperList = swiperList
   
    })

     this.$Axios({
      method:'get',
      url:'/city'
    }).then(backdata=>{
        this.cityList = backdata.data.data
    })
  },
  components: {
    HomeHeader,
    HomeSwiper,
    HomeIcons,
    HomeRecommend,
    HomeWeekend
  }
};
</script>

<style lang='stylus' scoped></style>